package com.wang.friend.domain.user;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.wang.common.core.domain.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@TableName("tb_user_submit")
public class UserSubmit extends BaseEntity {

    @Schema(description = "提交id")
    @TableId(value = "submit_id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long submitId;

    @Schema(description = "用户id")
    private Long userId; //唯一确定用户

    @Schema(description = "题目id")
    private Long questionId;  //唯一确定题目

    @Schema(description = "竞赛id")
    private Long examId;   //唯一确定竞赛

    //根据以上的数据即可确定数据库中唯一的信息


    @Schema(description = "代码语言类型: 0-->Java ; 1-->C++")
    private Integer programType;

    @Schema(description = "用户提交的代码")
    private String userCode;

    @Schema(description = "是否通过: 0-->未通过 ; 1-->通过")
    private Integer pass;

    @Schema(description = "得分")
    private Integer score;

    @Schema(description = "报错信息")
    private String exeMessage;

    @Schema(description = "测试用例执行结果")
    private String caseJudgeResult;
}
